package cn.bdqn.t354;

import cn.bdqn.t354.entity.User;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringbootAutoConfigApplication {
    public static void main(String[] args) {
        //SpringApplication.run(Springboot02Application.class, args);

        //测试使用java类代替配置文件的效果
        ConfigurableApplicationContext context = SpringApplication.run(SpringbootAutoConfigApplication.class, args);
        User user=(User)context.getBean("user");
        System.out.println(user.getName());
        System.out.println(user.getAge());
    }

}
